import java.io.*;
import java.util.*;

class Read1 {
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    String next() throws IOException {
        while(!st.hasMoreTokens()) {
            st = new StringTokenizer(bf.readLine());
        }
        return st.nextToken();
    }

    String nextLine() throws IOException {
        return bf.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
}
public class day5 {
    /**
     * 滑动窗口
     * 比那名居的桃子
     * https://ac.nowcoder.com/acm/problem/224679
     */
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        long[] a = new long[n + 1];
        long[] b = new long[n + 1];
        for(int i = 1;i <= n;i++) {
            a[i] = in.nextLong();
        }
        for(int i = 1;i <= n;i++) {
            b[i] = in.nextLong();
        }

        int start = 0;
        int left = 1,right = 1;
        // 注意这里的 long 类型
        long sumA = 0,sumB = 0;
        long maxA = 0;
        long minB = 0;
        while(right <= n) {
            // 进窗口
            sumA += a[right];
            sumB += b[right];

            // 判断是否出窗口
            while(right - left + 1 > k) {
                // 出窗口
                sumA -= a[left];
                sumB -= b[left];
                left++;
            }

            // 判断是否更新结果
            if(right - left + 1 == k) {
                if(sumA > maxA) {
                    maxA = sumA;
                    minB = sumB;
                    start = left;
                }else if(sumA == maxA && sumB < minB) {
                    start = left;
                    minB = sumB;
                }
            }
            right++;
        }
        System.out.println(start);
    }


    /**
     * 模拟
     * 十字爆破
     * https://ac.nowcoder.com/acm/problem/205836
     */
    private static PrintWriter out =
            new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static Read1 in = new Read1();

    public static void main2(String[] args) throws IOException {
        int n = in.nextInt();
        int m = in.nextInt();
        long[][] arr = new long[n][m];
        long[] row = new long[n]; // 某一行的所有值的和
        long[] col = new long[m]; // 某一列的所有值的和

        for(int i = 0;i < n;i++) {
            for(int j = 0;j < m;j++) {
                arr[i][j] = in.nextLong();
                // 把输入的值加入到对应的i行 j列 的位置
                row[i] += arr[i][j];
                col[j] += arr[i][j];
            }
        }
        // 这时row[i] 存储的就是 i这一行的所有值的和，col[j] 存储的就是 j这一列的所有值的和
        for(int i = 0;i < n;i++) {
            for(int j = 0;j < m - 1;j++) {
                out.print(row[i] + col[j] - arr[i][j] + " ");
            }
            out.println(row[i] + col[m - 1] - arr[i][m - 1]);
        }
        out.close();
    }


    /**
     * 模拟
     * BC45 小乐乐改数字
     * https://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d?tpId=290&tqId=39833&ru=/exam/oja
     */
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] arr = in.next().toCharArray();
        int n = arr.length;
        int[] ret = new int[n];

        for(int i = 0;i < n;i++) {
            int x = (int) arr[i];
            if(x % 2 == 0){
                // 偶数
                ret[i] = 0;
            }else {
                ret[i] = 1;
            }
        }

        // 处理前导零
        int index = 0;
        while(index < n - 1 && ret[index] == 0) {
            index++;
        }
        while(index < n) {
            System.out.print(ret[index++]);
        }
    }
}
